//
//  YSGMeetingLoadingView.swift
//  EyeVisionForDoctors
//
//  Created by PMC on 2022/9/19.
//  Copyright © 2022 tao Tao. All rights reserved.
//

import UIKit
import Alamofire

class YSGMeetingLoadingView: UIView {
    private let tips = UILabel()
    init() {
        super.init(frame: .zero)
        initLayout()
        checkNetwork()
    }
    
    func initLayout() {
        addSubview(tips)
        tips.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.centerY.equalTo(clSafeAreaInsets.top).offset(navBarH / 2)
        }
        tips.textColor = .textGray
        tips.font = .medium_16
        tips.text = "等待对方接受邀请.."
    }
    
    func checkNetwork() {
        let reachability = NetworkReachabilityManager()
        reachability?.startListening(onUpdatePerforming: { status in
            switch status {
            case .reachable(.cellular):
                HUDTool.show(message: "移动网络下将产生手机流量")
            default:
                break
            }
        })
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
